package com.qingcloud.adminbackend.entity.product;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
 * <p>
 * 产品指令字段配置表
 * </p>
 *
 * @author wangjinnan
 * @since 2022-08-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_product_command_field")
public class SysProductCommandField implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("指令ID")
    private Integer commandId;

    @ApiModelProperty("字段名称")
    private String fieldName;

    @ApiModelProperty("字段索引序号")
    private Integer fieldIndex;

    @ApiModelProperty("字段描述")
    private String fieldDesc;

    @ApiModelProperty("字段值,固定值类型才有内容")
    private String fieldValue;

    @ApiModelProperty("字段类型 1固定值 2用户输入 3计算")
    private Integer valueFrom;

    @ApiModelProperty("字段值类型 string, long, int, short, float, byte, byte[]")
    private String valueType;

    @ApiModelProperty("输入表单类型 input，select, radio, checkbox")
    private String inputType;

    @ApiModelProperty("输入表单类型标题")
    private String inputTitle;

    @ApiModelProperty("是否必填 1-是 2-否")
    private Integer required;

    @ApiModelProperty("输入提示")
    private String inputTips;

    @ApiModelProperty("下拉,单选,多选输入的可选值: 格式 label|value,label2|value2")
    private String inputOptions;

    @ApiModelProperty("字段值数组")
    @TableField(exist = false)
    private List<String> fieldValueList = Collections.emptyList();

}
